package org.emet.service;

import org.springframework.flex.core.ExceptionTranslator;

import flex.messaging.MessageException;

public class ExceptionTranslatorImpl implements ExceptionTranslator {
	public boolean handles(final Class<?> clazz) {
		return Boolean.TRUE;
	}

	public MessageException translate(final Throwable throwable) {
		final MessageException exception = new MessageException();
		if (throwable != null) {
			exception.setRootCause(throwable);
			exception.setMessage(throwable.getMessage());
		}

		return exception;
	}
}